package com.tarena.lbs.dao.mapper;

import com.tarena.lbs.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    User selectById(Long id);

    User selectByUsername(String username);

    List<User> selectAll();

    int insert(User user);

    int update(User user);

    int deleteById(Long id);

    // 根据位置查询附近用户
    List<User> selectNearbyUsers(@Param("latitude") Double latitude,
                                 @Param("longitude") Double longitude,
                                 @Param("distance") Double distance);
}
